// DisplaySettings.cpp : implementation file
//

#include "stdafx.h"
#include "CookieTerm.h"
#include "DisplaySettings.h"

// CDisplaySettings

//char* CDisplaySettings::SupportedEncodings[2] =
//	{
//		"us-ascii", "GB18030"
//	};


CDisplaySettings CDisplaySettings::Default;

CDisplaySettings::CDisplaySettings()
{
	// Populate default values
	this->name = _T("Default");
	this->columns = 80;
	this->rows = 25;
	this->fontName = _T("SimSun");
	this->fontSize = 24;
	this->cursorColor = 0x00FFFF;
	this->blinkingInterval = 750;

	this->palette[0] = 0x000000; // Black
	this->palette[1] = 0x0000CC; // Red
	this->palette[2] = 0x00CC00; // Green
	this->palette[3] = 0x00CCCC; // Yellow
	this->palette[4] = 0xCC0000; // Blue
	this->palette[5] = 0xCC00CC; // Magenta
	this->palette[6] = 0xCCCC00; // Cyan
	this->palette[7] = 0xCCCCCC; // White

	this->boldPalette[0] = 0x666666; // Black
	this->boldPalette[1] = 0x6666FF; // Red
	this->boldPalette[2] = 0x66FF66; // Green
	this->boldPalette[3] = 0x66FFFF; // Yellow
	this->boldPalette[4] = 0xFF6666; // Blue
	this->boldPalette[5] = 0xFF66FF; // Magenta
	this->boldPalette[6] = 0xFFFF66; // Cyan
	this->boldPalette[7] = 0xFFFFFF; // White
}

//CDisplaySettings::CDisplaySettings(const CDisplaySettings& other)
//{
//	*this = other;
//}

CDisplaySettings::~CDisplaySettings()
{
}

// CDisplaySettings member functions

const LPCTSTR CDisplaySettings::Name() const
{
	return this->name;
}

const int CDisplaySettings::Rows() const
{
	return this->rows;
}

const int CDisplaySettings::Columns() const
{
	return this->columns;
}

const LPCTSTR CDisplaySettings::FontName() const
{
	return this->fontName;
}

const int& CDisplaySettings::FontSize() const
{
	return this->fontSize;
}

const COLORREF* CDisplaySettings::Palette() const
{
	return this->palette;
}

const COLORREF* CDisplaySettings::BoldPalette() const
{
	return this->boldPalette;
}

const COLORREF CDisplaySettings::CursorColor() const
{
	return this->cursorColor;
}

const int CDisplaySettings::BlinkingInterval() const
{
	return this->blinkingInterval;
}

//CDisplaySettings& CDisplaySettings::operator=(const CDisplaySettings& other)
//{
//	this->name = other.name;
//	this->rows = other.rows;
//	this->columns = other.columns;
//	this->fontName = other.fontName;
//	this->fontSize = other.fontSize;
//	this->cursorColor = other.cursorColor;
//
//	return *this;
//}